<template>
  <view class="container">
    <view class="status-bar"></view>
    
    <view class="header">
      <view class="header-left">
        <view class="back-btn" @tap="goBack">
          <text class="icon">←</text>
        </view>
      </view>
      <view class="header-center">
        <text class="title">我的</text>
      </view>
      <view class="header-right">
        <view class="settings-btn" @tap="openSettings">
          <text class="icon">⚙️</text>
        </view>
      </view>
    </view>

    <scroll-view class="main-content" scroll-y>
      <view class="profile-section">
        <view class="profile-card">
          <view class="avatar">
            <text class="avatar-text">游</text>
          </view>
          <view class="profile-info">
            <text class="username">游客用户</text>
            <text class="user-desc">武夷山文化爱好者</text>
          </view>
          <view class="profile-action">
            <text class="login-btn" @tap="handleLogin">登录</text>
          </view>
        </view>
      </view>

      <view class="stats-section">
        <view class="stats-grid">
          <view class="stat-item">
            <text class="stat-number">0</text>
            <text class="stat-label">已游览</text>
          </view>
          <view class="stat-item">
            <text class="stat-number">0</text>
            <text class="stat-label">已收藏</text>
          </view>
          <view class="stat-item">
            <text class="stat-number">0</text>
            <text class="stat-label">已分享</text>
          </view>
        </view>
      </view>

      <view class="menu-section">
        <view class="menu-group">
          <view class="menu-item" @tap="openMenu('collection')">
            <view class="menu-icon">
              <text>❤️</text>
            </view>
            <text class="menu-text">我的收藏</text>
            <text class="menu-arrow">></text>
          </view>
          <view class="menu-item" @tap="openMenu('history')">
            <view class="menu-icon">
              <text>📚</text>
            </view>
            <text class="menu-text">游览历史</text>
            <text class="menu-arrow">></text>
          </view>
          <view class="menu-item" @tap="openMenu('booking')">
            <view class="menu-icon">
              <text>🎫</text>
            </view>
            <text class="menu-text">我的预约</text>
            <text class="menu-arrow">></text>
          </view>
        </view>

        <view class="menu-group">
          <view class="menu-item" @tap="openMenu('feedback')">
            <view class="menu-icon">
              <text>💬</text>
            </view>
            <text class="menu-text">意见反馈</text>
            <text class="menu-arrow">></text>
          </view>
          <view class="menu-item" @tap="openMenu('about')">
            <view class="menu-icon">
              <text>ℹ️</text>
            </view>
            <text class="menu-text">关于我们</text>
            <text class="menu-arrow">></text>
          </view>
        </view>
      </view>
    </scroll-view>
  </view>
</template>

<script setup>
import { ref } from 'vue'

const isLoggedIn = ref(false)

const goBack = () => {
  console.log('返回')
}

const openSettings = () => {
  console.log('打开设置')
}

const handleLogin = () => {
  console.log('登录')
}

const openMenu = (menuType) => {
  console.log('打开菜单:', menuType)
}
</script>

<style scoped>
.container {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(180deg, #e8f5e8 0%, #c8e6c9 50%, #81c784 100%);
  color: #2e7d32;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.status-bar {
  height: 44px;
  width: 100%;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn, .settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.title {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #1b5e20;
}

.subtitle {
  display: block;
  font-size: 11px;
  color: #4caf50;
  margin-top: 2px;
  letter-spacing: 1px;
}

.main-content {
  flex: 1;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
}

.profile-section {
  margin-bottom: 24px;
}

.profile-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: #4caf50;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-text {
  font-size: 24px;
  font-weight: bold;
  color: white;
}

.profile-info {
  flex: 1;
}

.username {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #1b5e20;
  margin-bottom: 4px;
}

.user-desc {
  font-size: 14px;
  color: #4caf50;
}

.profile-action {
  flex-shrink: 0;
}

.login-btn {
  background: #4caf50;
  color: white;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: bold;
}

.stats-section {
  margin-bottom: 24px;
}

.stats-grid {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 24px;
  font-weight: bold;
  color: #1b5e20;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #4caf50;
}

.menu-section {
  margin-bottom: 100px;
}

.menu-group {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-right: 16px;
}

.menu-text {
  flex: 1;
  font-size: 16px;
  color: #1b5e20;
}

.menu-arrow {
  font-size: 16px;
  color: #81c784;
}
</style>
